//package com.swanclouds.redfish.account.domain.builder;
//
//import com.fasterxml.jackson.annotation.JsonProperty;
//import com.fasterxml.jackson.core.JsonProcessingException;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.google.common.collect.Lists;
//import com.swanclouds.model.account.builder.LdapGroupBuilder;
//import com.swanclouds.redfish.common.redfish.MemberModel;
//
//import java.util.List;
//
//public class LdapGroupConcreteBuilder implements LdapGroupBuilder {
//
//    @JsonProperty("GroupName")
//    private String groupName;
//
//    @JsonProperty("GroupDomain")
//    private String groupDomain;
//
//    @JsonProperty("GroupFolder")
//    private String groupFolder;
//
//    @JsonProperty("GroupRole")
//    private String groupRole;
//
//    @JsonProperty("GroupLoginRule")
//    private List<MemberModel> groupLoginRule;
//
//    @JsonProperty("GroupLoginInterface")
//    private List<String> groupLoginInterface;
//
//    private LdapGroupConcreteBuilder() {}
//
//    public static LdapGroupBuilder builder() {
//        return new LdapGroupConcreteBuilder();
//    }
//    @Override
//    public LdapGroupBuilder GroupName(String groupName) {
//        this.groupName = groupName;
//        return this;
//    }
//
//    @Override
//    public LdapGroupBuilder GroupFolder(String groupFolder) {
//        this.groupFolder = groupFolder;
//        return this;
//    }
//
//    @Override
//    public LdapGroupBuilder GroupDomain(String groupDomain) {
//        this.groupDomain = groupDomain;
//        return this;
//    }
//
//    @Override
//    public LdapGroupBuilder GroupRole(String groupRole) {
//        this.groupRole = groupRole;
//        return this;
//    }
//
//    /**
//     * Ldap用户组的登录规则 数组，数组中是字符串，可填多个，形如：["Rule1","Rule2","Rule3"]
//     *
//     * @param groupLoginRule 登录规则
//     * @return the builder ldap group
//     */
//    @Override
//    public LdapGroupBuilder GroupLoginRule(List<String> groupLoginRule) {
//        if (groupLoginRule == null) {
//            return this;
//        }
//        if (this.groupLoginRule == null) {
//            this.groupLoginRule = Lists.newArrayList();
//        }
//        groupLoginRule.stream().forEach(id -> {
//            this.groupLoginRule.add(new MemberModel());
//        });
//        return this;
//    }
//
//    /**
//     * Ldap用户组的登录接口数组，数组中是字符串，可填多个
//     *
//     * @param groupLoginInterface 登录接口
//     * @return the builder ldap group
//     */
//    @Override
//    public LdapGroupBuilder GroupLoginInterface(List<String> groupLoginInterface) {
//        this.groupLoginInterface = groupLoginInterface;
//        return this;
//    }
//
//    @Override
//    public String toString() {
//        ObjectMapper objectMapper = new ObjectMapper();
//        try {
//            return objectMapper.writeValueAsString(this);
//        } catch (JsonProcessingException e) {
//        }
//        return "LdapGroupConcreteBuilder {" +
//                "groupName='" + groupName + '\'' +
//                ", groupDomain='" + groupDomain + '\'' +
//                ", groupFolder='" + groupFolder + '\'' +
//                ", groupRole='" + groupRole + '\'' +
//                ", groupLoginRule=" + groupLoginRule +
//                ", groupLoginInterface=" + groupLoginInterface +
//                '}';
//    }
//}